<template>
  <div>
    <CategorySelector :disabled="isShow !== 1" />
    <SupList v-if="isShow == 1" @setIsShow="setIsShow" />
    <AddOrUpdateSpu v-else-if="isShow === 2" @setIsShow="setIsShow" />
    <AddSku v-else @setIsShow="setIsShow"></AddSku>
  </div>
</template>

<script lang="ts">
export default {
  name: "JSpu",
};
</script>

<script lang="ts" setup>
import { ref } from "vue";
import SupList from "./components/SupList.vue";
import CategorySelector from "@/components/CategorySelector/index.vue";
import AddOrUpdateSpu from "./components/AddOrUpdateSpu.vue";
import AddSku from "./components/AddSku.vue";

// 组件切换显示编辑标识
const isShow = ref(1);

const setIsShow = (newVal: number) => {
  isShow.value = newVal;
};
</script>

<style scoped></style>
